# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=reaver-wps-fork-t6x
pkgver=318.f9b5e15
pkgrel=1
pkgdesc='Brute force attack against Wifi Protected Setup mod with Pixie Dust Attack.'
arch=('x86_64' 'aarch64')
url='https://github.com/t6x/reaver-wps-fork-t6x'
license=('GPL2')
depends=('libpcap' 'sqlite3' 'pixiewps')
makedepends=('git')
backup=('etc/reaver/reaver.db')
replaces=('reaver' 'reaver-svn' 'reaver-git')
conflicts=('reaver' 'reaver-svn' 'reaver-git')
provides=('reaver')
source=("git+https://github.com/t6x/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

build() {
  cd "$pkgname/src"

  ./configure --prefix=/usr --sysconfdir=/etc

  make
}

package() {
  cd $pkgname

  install -Dm 755 src/reaver "$pkgdir/usr/bin/reaver"
  install -Dm 755 src/wash "$pkgdir/usr/bin/wash"
  #install -Dm644 src/reaver.db "$pkgdir/etc/reaver/reaver.db"
  install -Dm 644 docs/README "$pkgdir/usr/share/doc/reaver/README"
  install -Dm 644 docs/reaver.1 "$pkgdir/usr/share/man/man1/reaver.1.gz"
}

